Differential Equations · Exact Equations · Calc 3 Bridge

From dy/dx to the
Hidden Surface

Why exact differential equations are just slope equations wearing a gradient disguise — and how to see through it.

Two Things That Look Different But Aren't

You know this form cold:

\[\frac{dy}{dx} = f(x,y)\]

It means slope. At each point \((x,y)\) you get a number telling you how steeply \(y\) rises relative to \(x\).

Then your textbook hands you this:

\[M(x,y)\,dx + N(x,y)\,dy = 0\]

And it looks like something completely different — differentials multiplied by functions, all summed to zero. Where's the slope? Where's the derivative? What is this thing?

The big reveal: these are literally the same equation. One is written in slope language, the other in differential language. The content is identical — only the notation changed. The rest of this page shows exactly why, with no steps skipped.

What Does \(dx\) Mean, Actually?

Before connecting the two forms, let's nail down what \(dx\) and \(dy\) actually are — because this is where most courses gloss over something important.

Think of \(dx\) as an infinitesimally tiny nudge in the \(x\) direction, and \(dy\) as the resulting infinitesimal change in \(y\).

If you have a curve \(y = y(x)\), the relationship between these nudges is:

\[dy = \frac{dy}{dx}\,dx\]

Read that carefully: \(dy\) is not the same thing as \(\frac{dy}{dx}\). The derivative \(\frac{dy}{dx}\) is the ratio. The differential \(dy\) is the tiny change itself. Multiply the ratio by \(dx\) and you get \(dy\).

Geometric picture: if you zoom infinitely far into a smooth curve, it looks like a straight line. On that tiny straight segment, \(dx\) is the horizontal run, \(dy\) is the vertical rise, and \(\frac{dy}{dx}\) is the slope (rise over run). The differential form just writes both the rise and the run explicitly instead of computing the ratio.

Converting Between Forms — Step by Step

Starting from the differential form:

\[M(x,y)\,dx + N(x,y)\,dy = 0\]
1

Divide every term by \(dx\).

We can do this because \(dx \neq 0\) — it's infinitesimally small but nonzero. Dividing by it is legal.

\[\frac{M(x,y)\,dx}{dx} + \frac{N(x,y)\,dy}{dx} = \frac{0}{dx}\]

Simplify each term:

\[M(x,y) \cdot 1 + N(x,y) \cdot \frac{dy}{dx} = 0\]

Notice: \(\frac{dx}{dx} = 1\) and \(\frac{dy}{dx}\) is just the derivative.

2

Isolate \(\frac{dy}{dx}\).

Subtract \(M\) from both sides:

\[N(x,y)\frac{dy}{dx} = -M(x,y)\]

Divide both sides by \(N(x,y)\) (assuming \(N \neq 0\)):

\[\boxed{\frac{dy}{dx} = -\frac{M(x,y)}{N(x,y)}}\]

There it is. The exact equation \(M\,dx + N\,dy = 0\) is identical to the slope equation \(\frac{dy}{dx} = -M/N\). No new math was introduced — just algebra on the notation itself.

So why write it as \(M\,dx + N\,dy = 0\) at all? Because that symmetric form reveals something the slope form hides: this expression might be the total differential of some function. That's the actual point of exact equations — the notation is chosen to make the structure visible.

The Total Differential — Where Calc 3 Enters

From multivariable calculus, if you have a scalar function \(f(x,y)\), its total differential is:

\[df = \frac{\partial f}{\partial x}\,dx + \frac{\partial f}{\partial y}\,dy\]

Break this down term by term:

Now look at the exact equation again:

\[M(x,y)\,dx + N(x,y)\,dy = 0\]

If we can find a function \(f(x,y)\) such that:

\[M = \frac{\partial f}{\partial x} = f_x, \qquad N = \frac{\partial f}{\partial y} = f_y\]

Then the whole equation collapses into:

\[df = 0\]

This is the big insight. The equation \(df = 0\) says: as you move along the solution curve, the total change in \(f\) is zero. That means \(f\) is constant along the solution. So the solution is simply:

\[f(x,y) = C\]

The Geometric Picture — Level Curves

Here's how to think about this visually. Imagine a 3D surface — like a mountain. The function \(f(x,y)\) defines the height at every point \((x,y)\) in the plane.

A level curve (or contour line) is every point where the height is the same constant value. If you've ever looked at a topographic map, those rings are level curves.

Level curves of \(f(x,y) = x^2 + 2y^2\) — each ring is one solution \(f = C\)

The solution to an exact equation is one of these level curves. That's it. You're not drawing a path through a slope field — you're finding the contour of a hidden surface.

The Two Mental Models Side by Side

Form Mental Model What You're Finding
\(\frac{dy}{dx} = f(x,y)\) Following arrows in a slope field A path whose tangent always matches the slope
\(Mdx + Ndy = 0\) Walking a contour on a 3D surface A level curve where \(f(x,y) = C\)
Exact equation Gradient field with zero circulation The original scalar function \(f\) that generated the field

The hiking analogy: solving an exact equation is like being told "you walked at constant elevation the whole time" and asked to figure out which contour ring you were on. You're not following a path — you're identifying the contour.

The Exactness Test — Why \(\partial M/\partial y = \partial N/\partial x\)

Not every equation \(M\,dx + N\,dy = 0\) is exact. The test is:

\[\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}\]

To understand why this works, go back to what exactness requires:

\[M = f_x, \qquad N = f_y\]

If \(M = f_x\), then differentiating again with respect to \(y\):

\[\frac{\partial M}{\partial y} = \frac{\partial}{\partial y}(f_x) = f_{xy}\]

If \(N = f_y\), then differentiating with respect to \(x\):

\[\frac{\partial N}{\partial x} = \frac{\partial}{\partial x}(f_y) = f_{yx}\]

By Clairaut's theorem (mixed partials commute for smooth functions): \(f_{xy} = f_{yx}\). Therefore exactness requires \(\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}\).

Conservative field interpretation: if you've seen conservative vector fields in Calc 3, this is identical. The vector field \(\mathbf{F} = \langle M, N \rangle\) is conservative (comes from a gradient) if and only if \(\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}\). Exact equations are conservative vector fields. The "potential function" in physics is the same \(f(x,y)\) you're solving for.

Recovering \(f(x,y)\) — The Full Process

Once you know the equation is exact, here's how to find \(f(x,y)\) from scratch. Every step has a reason.

Say your equation is:

\[(2xy + 3)\,dx + (x^2 - 4y)\,dy = 0\]

So \(M = 2xy + 3\) and \(N = x^2 - 4y\).

Verify exactness first:

\[\frac{\partial M}{\partial y} = 2x, \qquad \frac{\partial N}{\partial x} = 2x \quad \checkmark\]
1

Integrate \(M\) with respect to \(x\).

We need \(f_x = M\), so integrate \(M\) in \(x\):

\[f = \int M\,dx = \int (2xy + 3)\,dx\]

Treat \(y\) as a constant during this \(x\)-integration:

\[f = x^2 y + 3x + g(y)\]

The \(+ g(y)\) is crucial — it's the "constant of integration" that can depend on \(y\), since anything purely in \(y\) vanishes when you differentiate with respect to \(x\).

2

Differentiate with respect to \(y\) and match to \(N\).

We also need \(f_y = N\). Differentiate the \(f\) we found:

\[\frac{\partial f}{\partial y} = x^2 + g'(y)\]

Set this equal to \(N = x^2 - 4y\):

\[x^2 + g'(y) = x^2 - 4y\]

The \(x^2\) terms cancel (this always happens if exactness holds — that cancellation is the payoff of the exactness test):

\[g'(y) = -4y\]
3

Integrate to find \(g(y)\).

\[g(y) = \int -4y\,dy = -2y^2\]

(No integration constant needed here — it gets absorbed into the final \(C\).)

4

Assemble the solution.

\[f(x,y) = x^2 y + 3x - 2y^2 = C\]

This implicit equation is the family of level curves — the full solution to the ODE.

The Gradient Connection — Why This Is Really Physics

The exact equation \(M\,dx + N\,dy = 0\) can be written as a dot product:

\[\langle M, N \rangle \cdot \langle dx, dy \rangle = 0\]

The vector \(\langle dx, dy \rangle\) is the infinitesimal displacement along the solution curve. The condition says this displacement is perpendicular to the vector \(\langle M, N \rangle = \langle f_x, f_y \rangle = \nabla f\).

But from Calc 3 you know: the gradient is always perpendicular to level curves.

Gradient vectors \(\nabla f\) (gold) are perpendicular to level curves (teal) — the solution curve is the level curve

The unified picture:

  • The solution curve has displacement \(\langle dx, dy \rangle\) tangent to it at every point.
  • The gradient \(\nabla f\) is perpendicular to the solution curve at every point.
  • So \(\nabla f \cdot \langle dx, dy \rangle = 0\) is automatically satisfied along a level curve.
  • This is exactly what \(df = 0\) says — you move without changing \(f\).

When It's Not Exact — Integrating Factors

If \(\frac{\partial M}{\partial y} \neq \frac{\partial N}{\partial x}\), the equation isn't exact yet. The vector field \(\langle M, N \rangle\) doesn't come from a potential function as-is.

But you can multiply the whole equation by a carefully chosen function \(\mu(x,y)\):

\[\mu M\,dx + \mu N\,dy = 0\]

and hope that this new equation is exact. The function \(\mu\) is called an integrating factor.

When \(\mu\) Depends Only on \(x\)

If the quantity

\[h(x) = \frac{1}{N}\left(\frac{\partial M}{\partial y} - \frac{\partial N}{\partial x}\right)\]

depends only on \(x\) (no \(y\) terms), then:

\[\mu(x) = e^{\int h(x)\,dx}\]

Multiplying through by this \(\mu\) makes the equation exact. The geometric intuition: you're re-scaling the vector field so that its curl vanishes — making it conservative.

Why exponential? The exactness condition on \(\mu M\,dx + \mu N\,dy = 0\) produces a differential equation for \(\mu\) itself. When \(\mu\) depends only on \(x\), that equation simplifies to \(\frac{d\mu}{dx} = h(x)\mu\), which is a separable equation with solution \(\mu = e^{\int h\,dx}\). The integrating factor is the solution to its own mini-ODE.

The Full Map

Concept Symbol / Form What it means geometrically
Slope form \(\frac{dy}{dx} = -M/N\) Tangent direction to the solution curve
Differential form \(Mdx + Ndy = 0\) Displacement \(\langle dx,dy\rangle\) perpendicular to \(\langle M,N\rangle\)
Exactness condition \(M_y = N_x\) \(\langle M,N\rangle\) is a conservative (gradient) field
Total differential = 0 \(df = 0\) Moving along constant-height contour of surface \(f\)
Solution \(f(x,y) = C\) A family of level curves — one per initial condition
Integrating factor \(\mu \cdot (Mdx + Ndy) = 0\) Re-scale the field until it becomes conservative

One-sentence summary: an exact differential equation is a DE that secretly encodes zero total change in some hidden scalar function — your job is to recover that function, and the solution is just its level curves.